/**********************************************************
    COPYRIGHT
        LGX,Inc . (c) 2011
    CLASS NAME
        decode_config.h
    DEPENDENCY

    HISTORY
		02/28/2012, created by Guangxing Liu
**********************************************************/
#ifndef DECODE_CONFIG_H
#define DECODE_CONFIG_H

#define TRUE 1
#define FALSE 0
#define NULL 0
#define decode_volatile volatile 
#define DECODE_MAX_PORT_NUM 50

typedef enum
{
	P_NONE=0,
	P0,
	P1,
	P2,
	P3,
	P4,
	P5,
	P6,
	P7,
	P8,
	P9,
	P10,
	P11,
	P12,
	P13,
 	P14,
	P15,
	P16,
	P17,
	P18,
	P19
}PORT_NAME;
typedef enum
{
	V_NONE=0,
	V0,
	V1,
	V2,
	V3,
	V4,
	V5,
	V6,
	V7,
	V8,
	V9,
	V10,
	V11,
	V12,
	V13,
 	V14,
	V15,
	V16,
	V17,
	V18,
	V19
}VALUE_NAME;


typedef enum
{
	DECODE_FUNCTION_NONE=0,
	DECODE_GPIO,
	DECODE_PWM,
	DECODE_ADC,
	DECODE_DAC,
	DECODE_COUNTER,
	DECODE_LD

}PORT_FUNCTION;

typedef enum
{
	DECODE_ACTION_NONE=0,
	DECODE_SET_DIR,
	DECODE_SET_VALUE,
	DECODE_GET_VALUE,
	DECODE_PAUSE,
	
}PORT_ACTION;

typedef struct _decode_port_status_
{
	unsigned char port_name;
	unsigned char port_func;
	unsigned char port_action;
         int    port_value;
}Decode_Port_Status;

typedef struct _decode_compare_value_
{
	int compare_v1;
	int compare_v2;
}decode_compare_value;

#define GPIO_DIR_INPUT   (0)
#define GPIO_DIR_OUTPUT (1)

extern void platform_command_execute(unsigned char func,unsigned char port_n, int port_value,unsigned char port_action,unsigned char value_n,int value_value);

extern volatile int platform_decode_value[DECODE_MAX_PORT_NUM];


















#endif

